FROM golang as builder

COPY . /go/src/app/
WORKDIR /go/src/app/

RUN go env -w GOPROXY=https://goproxy.cn,direct
RUN go mod tidy
RUN CGO_ENABLED=0 GOOS=linux go build -o app_linux 

FROM alpine
EXPOSE 9091

COPY --from=builder /go/src/app/ /app/

WORKDIR /app/
ENTRYPOINT ["./entrypoint.sh"]
